package cn.laixueit;

import java.util.Scanner;

/* xx系统的功能类*/
public class XxMenu {

    public void getUser(){
        Demo1 demo1 = new Demo1();
        System.out.println(demo1.user);
    }

    /*1 显示菜单*/
    public void showMenu(){
        System.out.println("----------");
        System.out.println("--1 登录--");
        System.out.println("--2 显示个人信息--");
        System.out.println("--3 修改密码---");
        System.out.println("--0 退出系统---");
        System.out.println("----------");
    }
    /* 2 登录*/
    public boolean login(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("开始登录");
        System.out.println("请输入您的账号:");
        String inputLoginId = scanner.next();
        System.out.println("请输入您的密码:");
        String inputPwd = scanner.next();
        User user = new User();
        String loginId = user.loginId;
        String pwd = user.pwd;
        if(loginId.equals(inputLoginId) && pwd.equals(inputPwd)){
            return true;
        }
        return false;
    }

    /*修改密码*/
    public void changePwd(){
        System.out.println("开始修改密码");
        System.out.println("请输入您的新密码:");
        Scanner scanner = new Scanner(System.in);
        String newPwd = scanner.next();
        User user = new User();
        user.pwd = newPwd;
        System.out.println("密码修改成功");
    }


}
